Plugin: Unarmored Skill for Everyone
Author: Low Post
Version: 2.4.0
__________________________________________________________________________________________
1. Description
2. Installation / Uninstallation
3. "Technical" information & useful console commands
4. Known Bugs & Issues / Incompatibilities
5. Hosting Information
6. Contact
7. Changelog
8. Used Tools
9. Credits

	+-----------------------------------------------------------------------------------+
					    ATTENTION:					    
		      This is a revision of GalerionTrueUnarmored by Galerion.		    
	  Unfortunately, I wasn't able to make contact with him and the ReadMe doesn't say 
				    anything about such cases.				    
		Therefore, I don't have the permission to release this Plugin.		    
	Although, I don't want to deprive the community of this Plugin. I put this warning 
	 at the top of the ReadMe, so everyone who doesn't want to use a revision released 
			without written permission can forgo this Plugin.		    
	+-----------------------------------------------------------------------------------+

==============
1. Description
==============

This Plugin is an enhancement/revision of GalerionTrueUnarmored 2.0.1:
It adds an "Unarmored skill" to the game.
This causes players to get a defense bonus even without wearing an armor so that magiacians 
who prefer using robes have a chance, too. The defense bonus depends on you current Unarmored 
Skill, but also from the armor you're wearing. Certainly, you only get a bonus for the 
unarmored parts of your body. ;)
Certainly, the unarmored defense bonus will never be the same as the best one you get from 
an armor. You can find a comparison chart under point 3. It's assumed that you get the 
maximum bonus possible (which means you wear no/the complete armor).
Compared to the original version, I changed the following things:
      - I used OBSE-commands for a better imitation of a "real" skill:
	      * It's possible to use the unarmored skill as a major skill.
		You can either replace one of the default major skills, or use it as an 
		additional major skill.
	      * The Unarmored skill now has a governing attribute: agility
	      * Skill improvement only if neither heavy, nor light armor has been improved
		(only when the body, not the armor, was hit)
	      * Using a true exponential function (Pow)
	      * Percentual damage to the unarmored-bonus by means of equipped pieces of armor
	      * The skill level used by the calculations is influence by luck and fatigue.
      - Including trainer for the Unarmored skill
	      * Training the Unarmored skill used Training sessions, just like a normal skill 
		does.
	      * The first trainer lives in Anvil and leaves his home for 2 hours every day to 
		take a walk.
	      * All new dialogs are non-vocal. I suggest to use Universal Silent Voice:
			http://www.tesnexus.com/downloads/file.php?id=16622
      - Displaying the skill level with a faction
      - Reducing the time to check wether the player has been hit
		The time between two updates can be chanded discretionary.
		Use the following console command:
			set LPUSfEGlDelayTime to x
		x is the time between two Updates in seconds.
			Standard: 0.5 (GalerionTrueUnarmored: 1.0)
      - NPC get the unarmored skill, too (won't be trained)
		That's the main reason I made this Plugin, because I thought it 
		was unfair that only the Player got an unarmored skill. :)
		Because this component causes CTDs for some players you can disable it using 
		the following console command:
			set LPUSfEGlEnableNPC to 0

					ATTENTION:
	This PI REQUIRES OBSE v0016 AND Pluggy v100 (or higher)!

================================
2. Installation / Uninstallation
================================

2.a.1) Installation
-------------------
Install OBSE v0016 (or higher).
Install Pluggy v100 (or higher).
Copy/Move the 'Unarmored Skill for Everyone.esp' into your '...\Oblivion\Data'-folder and 
activate the *.esp in the OblivionLauncher.
As long as this plugin is active always start Oblivion with the 'obse_loader.exe'.

2.a.2) Update from GalerionTrueUnarmored 2.0.1
----------------------------------------------
Follow the instructions at 2.a.1
Start Oblivion with both, GalerionTrueUnarmored & Unarmored Skill for Everyone activated.
Wait for the MessageBox informing you about the successful update and the Game quitting itself.
Deactivate GalerionTrueUnarmored, start Oblivion & load the automatically created SaveGame.
From now on everything should work like after a normal Installation.

2.a.3) Update from a previous version of Unarmored Skill for Everyone
---------------------------------------------------------------------
I strongly advice to create a Clean Save. Maybe just overwriting the old *.esp with the new 
one works, but this is rather unlikely to happen, because I added some Variables and deleted 
some unused ones which may confuse Oblivion. Therefore, I do NOT support bugs and problems 
which appeared due to this reason.
To create a Clean Save you have to uninstall the Plugin using the old version. After that, 
just replace the old *.esp with the new one and continue with the automatically created 
SaveGame.

2.b) Uninstallation
-------------------
For a clean uninstallation, unfortunatly, it isn't enough to just deactivate the plugin. The 
reason is that otherwise the player and all NPCs who've met him will keep the defense-bonus. 
Due to the mass of NPCs it isn't possible to fix this with a simple console command.
Therefore, I included a possibility which should faciliate a clean uninstallation:
Type the following command into your console (` or ~, left next to 1) while this plugin is 
still active:
	set LPUSfEGlUninstall to 1
After this the defense-bonus will be removed from all NPCs and the player. Additionally, the 
game will be saved (Uninstall Unarmored Skill for Everyone) and closed. Thereafter, you can 
deactivate & delete the *.esp without anything left into your savegame (Certainly you have 
to continue playing with the automatically created SaveGame ;) ).

====================================================
3. "Technical" information & useful console commands
====================================================

 - It's possible to display information about this PI in console. Therfore you have to use 
   the following console command:
	set LPUSfEGlShowDebug to x
   The following values (instead of x) should be interesting for the player:
	0: Doesn't display any Message (Standard)
	1: Displays "General Messages"
	3: Displays information about the unarmored skill of the NPC in the crosshair
	5: Displays information about the unarmored skill of the player
   You have to bear in mind that the last two will use the complete console. This can cause 
   Messages of other PIs not to be displayed.
	Note: from now on I'll use for the Debug-Test 5 (3) Player-Debug (NPC-Debug).

 - The maximum defense bonus is calculated with the following fomulas:
			until Skill 25:
defense Bonus = 0
		   Skill 25 --> Skill 100:
Defense Bonus = 9/2000*Skill^2
		   Skill 100 --> Skill 200:
Defense Bonus = 13/198000*Skill^3 - 6487/198000*Skill^2 + 2714/495*Skill - 23395/99
			ab Skill 200:
Defense Bonus = 500000/3/Skill^2 - 8500/3/Skill + 85
	ATTENTION: you won't get any defense bonus with a skill below 25
   Here's a comparison chart:
	 -------------------------------------------------------------------
	| Skill | Unarmored | Fur | Mithril | Glass | Iron | Ebony |Daedric |
	|   20  |     0     |  5  |    12   |   21  |  14  |   25  |   32   |
	|   30  |     4     |  9  |    14   |   23  |  20  |   30  |   34   |
	|   40  |     7     | 10  |    16   |   29  |  22  |   33  |   41   |
	|   50  |    11     | 12  |    20   |   31  |  24  |   40  |   45   |
	|   60  |    16     | 12  |    21   |   33  |  25  |   42  |   52   |
	|   70  |    22     | 13  |    24   |   38  |  30  |   45  |   54   |
	|   80  |    29     | 14  |    24   |   41  |  32  |   50  |   61   |
	|   90  |    36     | 14  |    26   |   43  |  34  |   53  |   64   |
	|   99  |    44     | 14  |    26   |   43  |  34  |   54  |   66   |
	|  100  |    50     | 30  |    48   |   73  |  40  |   60  |   72   |
	|  200  |    75     |  ?  |     ?   |    ?  |   ?  |    ?  |    ?   |
	 -------------------------------------------------------------------

   However, the value can still be reduced:
      * If you have a skill below 75 and carry more then half of your maximum encumbrance 
	limit (Encumbrance Limit at Player-Debug) your defense bonus will be reduced by x%
	of the maximum defense bonus, where x is how much percent you wear over the 
	(Player-Debug) encumbrance limit.
		( ( Encumbrance - EncumbranceLimit ) / EncumbranceLimit )
      * If you have a skill below 50 and wear at leat one piece of armor you won't get any 
	defense bonus
      * If you have a skill below 100 and wear at least one piece of armor your defense bonus 
	will be reduced by 5% of the maximum defense bonus.
      * Additionally, the bonus will be reduced by n%;
	n is the correponding GemeSetting(s) 'iArmorDamageXXChance'

	All "DamagePercents" are combined to TotalDamagePercent (at Player-/NPC-Debug).
	So, if TotalDamagePercent >= 1 the bonus will be 0.
   After every change (defense bonus is (not) penalized) per default a Message informing you 
   about this incident is displayed. You can disable them using the following console command:
	set LPUSfEGlShowMessages to 0

 - The staring value of the unarmored skill will be calculated as followed:
	Every calculation of the start level begins with a value of 5.
	In addition 10% the average of the Acrobatic, Alchemy, Alteration, Athletics, 
	HandToHand, Illusion, Mysticism, Restoration, Security and Sneak skill will be added.
	From this value 10% of the average of the Armorer, Blade, Blunt, Heavy Armor, 
	Light Armor and Marksman skill will be substracted.
	If you chosed Magic as class Specialization the value will be increased by 5.
	Provided that you chose to use the unarmored skill as a major skill this value will 
	be increased by 20.
  If you want to change the skill of the player you can use the following console command:
	set LPUSfEGlPlayerSkill to x

 - Something about the training of the unarmored skill:
      * Only works for the player
	       NPCs have a constant skill level which is calculated as follows:
		Primarily, the average of the Acrobatic, Alchemy, Alteration, Athletics, 
		HandToHand, Illusion, Mysticism, Restoration, Security and Sneak skill will 
		be calculated.
		From this value n% will be substracted; n is the average of the Armorer, 
		Blade, Blunt, Heavy Armor, Light Armor and Marksman skill.
		If the NPC has Magic as class Specialization the value will be increased by 5.
      * After the player has been in hurt during combat and neither light, nor heavy armor 
	has been trained the "Progress" will be increased by LPUSfESkillUseIncrement.
	You can change this value with the following console command:
		set LPUSfEGlSkillUseIncrement to x
	The current value can be viewed at Player-Debug in the console.
      * After Progress >= SkillNext a level up will follow and Skill Next will be newly 
	calculated (also happens after the calculation of the start skill). The calculation of 
	SkillNext will be the same like the one of a normal skill.

 - The maximum Skill level which can be reached is by default 100 
   (with OBSE_Elys_Uncapper 200, if activated in the *.ini). Beyond this there won't be any 
   training. You can change this value with the following console command:
	set LPUSfEGlMaximumSkillLevel to x

==========================================
4. Known Bugs & Issues / Incompatibilities
==========================================

4.a) Known Bugs & Issues
------------------------
 - The Trainers aren't fully integrated into the world of Tamriel, yet.
 - My english isn't the best. ;)

4.b) Known Incompatibilities
----------------------------
 - DarkUI'd DarN
	 Causes an extreme slowdown while in Menumode
 - nGCD, OXP & other alternative levelling systems
	 Not fully incompatible, so they won't work together in any way. It's just the case 
	  that the Unarmored skill isn't integrated in the new levelling system.
	 To come a bit closer to the Oblivion XP (OXP) levelling system it is advisable to 
	  use the following console command:
		set LPUSfEGlSkillUseIncrement to 0
	  It deactivates training through simple being-hit; training with trainers is still 
	  possible.

I plan to create some compatibility based (optional) adjustment to the plugins mentioned 
above (DarkUI'd DarN, nGCD & OXP). When they are created depends on how much time I have and 
how much time is required to create these adjustments.

======================
5. Hosting Information
======================

Due to this Plugin being a Open Beta-Version I expect more frequent Updates then a normal 
Plugin. Therefore, I do NOT allow to upload this Plugin anywhere else.
Once I declare the beta phase as finished the rules I specified for my other plugins apply to 
this one as well. Once things have progressed to that point, I'll specify them here, too.


If I left Oblivion-Modding someday and you want to do something else then hosting* this Plugin 
ask for a permission, first. ;)
If you can't get in contact with me (which means: no reply in a month or more using every 
way to contact me mentioned below) you can do whatever you was, as long as you give 
proper credits.


*If you can't get in contact with me and the Plugin isn't available anymore, you're also 
allowed to upload it on your site. ;)

==========
6. Contact
==========

You can contact me (Low Post) via Private Message in one of the following forums 
or by sending me a mail.

Mail address
	<spamviech@web.de>

Official ES forum
	http://www.bethsoft.com/bgsforums/

Multimediaxis
	http://www.multimediaxis.net/index.php
ElderScrollsGames.de
	http://www.elderscrollsgames.de/distribution/
Newraven.net
	http://forum.newraven.net/
World of Elder Scrolls
	http://forum.worldofplayers.de/forum/index.php
Scharesoft forum
	http://www.scharesoft.de/joomla/forum/index.php

============
7. Changelog
============

2.4.0:	- Fixed the last bit of incompatibility with DarkUI'd DarN (now for real).
	- Included Icons (Thanks to Laulajatar).
	- Faluel Donail, Akish & Fenas Erelie integrated into the world.
		* Currently without any schedule, they just stand there and do nothing.
		* The quest for the master trainer hasn't been implemented, too.
		  Currently you can train with him without any quest.

2.3.1:	- Fixed the last bit of incompatibility with DarkUI'd DarN.
	- Fixed a Bug which caused the Game to terminate without saving while deinstallation.

2.3.0:	- If the defense bonus was penalized because of too much weight, but not longer 
	  affected bye wearing some pieces of armor the wrong messages has been displayed.
	- Some little Tweaks in Sukchuk Dirr`tur's concealment
	- Fixed a Bug which disabled Training in the english Version.
	- Implemented the possibility to disable the Messages informing about a penalized 
	  defense bonus:
		set LPUSfEGlShowMessages to 0
	- Implemented the possibility to disable the NPC-Component of this Plugin:
		set LPUSFEGlEnableNPC to 0
	- Created compatibility to DarkUI'd DarN (hopefully).

2.2.2:	- Fixed the Calculation of TotalDamagePercent
	  Thanks to Scoopy for finding this Bug. :)

2.2.1:	- Error Messages for Armor are only displayed if the only Slot they use doesn't have 
	  an "iArmorDamageXXChance"-GameSetting.
		 In Addition the Name & ID of the Actor wearing it is displayed, too.
	- Moving on to OBSE-Strings. Nevertheless, Pluggy is still required.
	  (LC, GetFileSize, INIReadInt, Arrays)

2.2.0:	- Reduced Spam in Console produced by a massive usage of GetGameSetting.
	- Implemented Timer in Menumode, too.
	- Introduced Spells & Scroll to absorb/drain/fortify the unarmored skill.
	- Implemented Influence on the Skill by Luck & Fatigue.
	- Every Trainer now has a name :)
	- Changed the damage system a bit.

2.1.1:	- Fixed some Minor Bugs

2.1.0:	- Trainer for the Unarmored skill
	- Changing the calculation of the PlayerStartSkill

2.0.0:	- Increasing the required OBSE-Version to v0016
	- Implement a German Version
	  (Is determinded by the file size of the Oblivion.esm)
	  Changing possible with this console command:
			set LPUSfEGlQuest.Language to 0/1	;English/German
	-Additional approaches to a real skill:
		* Affection the attibute bonus for Agility on LevelUp
		* Possibility to use the Unarmored skill as a major skill, either replacing a 
		  normal major skill, or as an additional major skill. 
		  Affecting the LevelUp count.
		* Changing the calculation of the PlayerStartSkill
		  --> Increased similarity to vanilla-skills
			retained calculation for NPCs
		  --> otherwise, skill would be too low
	- Improved the method for checking equipped pieces of armor

1.0.2:	- Fixed a Bug which caused players without a specialization in magic to become a 
	  master of the unarmored skill with the first strike on an unarmored part of the body.
	- Fixed a Bug which caused an uncloseable MessageBox to appear when someone equipped a 
	  piece of Armor using an unusual Slot

1.0:	- Initial Release (Open Beta)

=============
8. Used Tools
=============

TES Construction Set:
	 http://theelderscrolls.info/?go=dlfile&fileid=158

Oblivion Script Extender:
	 http://www.obse.silverlock.org/

Pluggy:
	 http://karamail.nerim.net/elys/Pluggy/

Wrye Bash:
	 http://wrye.ufrealms.net/#WryeBash

Oblivion Mod Manager:
	 http://timeslip.chorrol.com/obmm_download.html

Name Generator:
	 http://www.silgrad.com/oblivion/rangen/index.html
	 http://www.meisterdermagie.de/ngen/ngen.html

==========
9. Credits
==========

Galerion for his "primal version" of this Plugin.

The OBSE-Team for the creation of OBSE and for realising a lot of my requests.
You all are just great. Keep up the good work. :)

Elys for creating Pluggy.

The guys from the CS-Wiki, who provide to (almost) every Script command a detailed Description.

haama because he explained to me how the thing with the Update works.

DWS, because he put my nose on the solution for the Slowdown with DarkUI'd DarN.
Who would think that a Return in the Gamemode-Block helps against Slowdons in Menumode?

Laulajatar, because he created the Icons and found another reason for the Slowdown with 
DarkUI'd DarN. Why causes a Variable as a float, but not as a long such problems when used 
with ModActorValue?
And why was it a float at all? :p

Satsuma, because he created Fenas Erelie's hut and everything around it.

Everyone who spends time writing tutorials.

Everyone who deserves it, but I forgot to mention. ;)